package com.example.dealdata.controller.chengyu;

import com.example.dealdata.pojo.chengyu.Chengyu_JL_Key;
import com.example.dealdata.service.chengyu.ChengyuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cy")
public class ChengyuContrlller {
    @Autowired
    private ChengyuService chengyuService;

    @GetMapping("/hi")
    public String hi(){
        return "say hi";
    }


    @GetMapping("/jl")
    public List<Chengyu_JL_Key>  jl(){
        //List<Chengyu_JL_Key> list = chengyuService.findByFKey("Yi");
        List<Chengyu_JL_Key> list = chengyuService.findGroupByfkey();
        return list;
    }

    @GetMapping("/genjl")
    public String genJl(){
        return chengyuService.creatJLData();
    }
}
